#coding=utf-8
from flask import Flask, jsonify,request
import os
from data.dataUtil import DataUtil



# class ChainNetwork(object):

root_path = os.getcwd()
app = Flask(__name__,root_path=root_path,static_folder='web')
dataUtil = DataUtil()

# def __init__(self):
#     print "Crystalcoin Network init"

@app.route('/')
def root():
    return app.send_static_file('room.html')

@app.route('/test/', methods=['GET'])
def test():
    result = {'pro1':'pro1value','pro2':'pro2value'}
    return jsonify(result)

@app.route('/question/<string:question>/', methods=['GET'])
def question(question=''):
    answer = {'address':dataUtil.config["public"],'topic':question}
    return jsonify(answer)

def run():
    app.run(host= '0.0.0.0',port=1024,debug=False)